package cn.etouch.huangli;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;


public class DBManager {

	public static int insertHuangli(String day,String value) throws SQLException{
		Connection con = ConnectionUtil.getInstance().getConnection();
		Statement s = con.createStatement();
		return s.executeUpdate("INSERT INTO `huangli`.`huangli` (`day`, `value`) VALUES ('"+day+"', '"+value+"');");
	}
	
	public static void getHuangli() throws SQLException{

			Connection con1 = ConnectionUtil.getInstance().getConnection();
			Statement s1 = con1.createStatement();
			ResultSet rs = s1.executeQuery("select * from huangli");
					while(rs.next()&&rs != null) {
						System.out.println(rs.getString(1));
						System.out.println("result find");
			}
	}

}
